package a.a;

import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.k;
import a.c.n;
import a.c.w;
import a.c.z;
import a.i.a.c;
import a.i.a.g;
import a.i.db;
import a.i.h;

public class fb
{
  public static boolean a;
  
  public static void a(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble)
  {
    a(paramq, parame, paramBoolean, paramArrayOfDouble, new d[paramq.j()]);
  }
  
  public static void a(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble, d[] paramArrayOfd)
  {
    int m = m.b;
    boolean bool = m.a;
    int i = paramq.j();
    h localh = new h(i + 1);
    int j = 0;
    if (j < i) {}
    do
    {
      paramArrayOfd[j] = null;
      paramArrayOfDouble[j] = (1.0D / 0.0D);
      j++;
      if ((m == 0) && (bool)) {
        break label93;
      }
      if (!bool) {
        break;
      }
      paramArrayOfDouble[parame.f()] = 0.0D;
    } while (m != 0);
    paramArrayOfd[parame.f()] = paramq.q();
    label93:
    localh.b(parame);
    break label214;
    if (!localh.g()) {}
    label132:
    label214:
    while (m != 0)
    {
      e locale = (e)localh.c();
      double d = paramArrayOfDouble[locale.f()] + 1.0D;
      d locald = locale.h();
      int k;
      do
      {
        do
        {
          do
          {
            if (locald == null) {
              break;
            }
            k = locald.f().f();
          } while (bool);
          if (paramArrayOfd[k] == null)
          {
            paramArrayOfd[k] = locald;
            paramArrayOfDouble[k] = d;
            localh.b(locald.f());
          }
          locald = locald.i();
        } while (!bool);
        if (m != 0) {
          break label132;
        }
        if (paramBoolean) {
          break;
        }
        locald = locale.i();
        if (locald == null) {
          break;
        }
        k = locald.e().f();
      } while (bool);
      if (paramArrayOfd[k] == null)
      {
        paramArrayOfd[k] = locald;
        paramArrayOfDouble[k] = d;
        localh.b(locald.e());
      }
      locald = locald.j();
      if (!bool) {
        break;
      }
    }
    paramArrayOfd[parame.f()] = null;
  }
  
  public static void a(a.c.q paramq, e parame, boolean paramBoolean, a.c.x paramx1, a.c.x paramx2)
  {
    double[] arrayOfDouble = b(paramq);
    d[] arrayOfd = c(paramq);
    a(paramq, parame, paramBoolean, arrayOfDouble, arrayOfd);
    a(paramq, arrayOfDouble, paramx1);
    a(paramq, arrayOfd, paramx2);
  }
  
  public static boolean a(a.c.q paramq, e parame, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
  {
    return a(paramq, parame, paramArrayOfDouble1, paramArrayOfDouble2, new d[paramq.j()]);
  }
  
  public static boolean a(a.c.q paramq, e parame, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, d[] paramArrayOfd)
  {
    int i1 = m.b;
    boolean bool = m.a;
    int i = paramq.j();
    int[] arrayOfInt = new int[i];
    if (i1 == 0) {
      if (!x.a(paramq, arrayOfInt)) {
        return false;
      }
    }
    e[] arrayOfe = new e[i];
    w localw = paramq.v();
    e locale;
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        locale = localw.d();
        arrayOfe[arrayOfInt[locale.f()]] = locale;
        localw.f();
      } while (!bool);
    } while (i1 != 0);
    int j = 0;
    if (j < i) {}
    while (i1 != 0)
    {
      paramArrayOfDouble2[j] = (1.0D / 0.0D);
      if (i1 != 0) {
        break label159;
      }
      paramArrayOfd[j] = null;
      j++;
      if (bool) {
        break label153;
      }
      if (!bool) {
        break;
      }
    }
    paramArrayOfDouble2[parame.f()] = 0.0D;
    label153:
    label159:
    if (i1 == 0) {}
    paramArrayOfd[parame.f()] = (paramq.l() == 0 ? null : paramq.q());
    j = 0;
    label320:
    do
    {
      if (j >= i) {
        break;
      }
      locale = arrayOfe[j];
      int k = locale.f();
      if (i1 != 0) {
        break label341;
      }
      if (bool) {
        break label339;
      }
      if (paramArrayOfd[k] != null)
      {
        double d = paramArrayOfDouble2[k];
        d locald = locale.h();
        do
        {
          if (locald == null) {
            break label320;
          }
          int m = locald.d();
          int n = locald.f().f();
          if (bool) {
            break;
          }
          if (paramArrayOfd[n] != null)
          {
            if (i1 != 0) {
              continue;
            }
            if (d + paramArrayOfDouble1[m] >= paramArrayOfDouble2[n]) {}
          }
          else
          {
            paramArrayOfd[n] = locald;
            paramArrayOfDouble2[n] = (d + paramArrayOfDouble1[m]);
          }
          locald = locald.i();
        } while (!bool);
      }
      j++;
    } while (!bool);
    if (i1 == 0) {
      label339:
      paramArrayOfd[parame.f()] = null;
    }
    label341:
    return true;
  }
  
  public static boolean a(a.c.q paramq, e parame, k paramk, a.c.x paramx1, a.c.x paramx2)
  {
    double[] arrayOfDouble1 = a(paramq, paramk);
    double[] arrayOfDouble2 = b(paramq);
    d[] arrayOfd = c(paramq);
    boolean bool = a(paramq, parame, arrayOfDouble1, arrayOfDouble2, arrayOfd);
    a(paramq, arrayOfDouble2, paramx1);
    a(paramq, arrayOfd, paramx2);
    return bool;
  }
  
  public static void a(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
  {
    a(paramq, parame, paramBoolean, paramArrayOfDouble1, paramArrayOfDouble2, new d[paramq.j()]);
  }
  
  public static void a(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, d[] paramArrayOfd)
  {
    int n = m.b;
    boolean bool = m.a;
    c localc = new c(paramq);
    int i = paramq.j();
    int j = 0;
    if (j < i) {
      paramArrayOfd[j] = null;
    }
    while (n != 0)
    {
      paramArrayOfDouble2[j] = (1.0D / 0.0D);
      j++;
      if ((n == 0) && (bool)) {
        break label81;
      }
      if (!bool) {
        break;
      }
    }
    paramArrayOfDouble2[parame.f()] = 0.0D;
    label81:
    localc.a(parame, 0.0D);
    label249:
    do
    {
      break label272;
      if (localc.a()) {
        break;
      }
      e locale1 = localc.b();
      int k = locale1.f();
      double d1 = paramArrayOfDouble2[k];
      e locale2;
      int m;
      double d2;
      do
      {
        locald = locale1.h();
        do
        {
          if (locald == null) {
            break label261;
          }
          locale2 = locald.f();
          m = locale2.f();
          d2 = d1 + paramArrayOfDouble1[locald.d()];
          if (bool) {
            break;
          }
          if ((paramArrayOfd[m] == null) && (locale2 != parame))
          {
            paramArrayOfDouble2[m] = d2;
            localc.a(locale2, d2);
            if ((n == 0) && (!bool)) {}
          }
          else
          {
            if (n != 0) {
              continue;
            }
            if (d2 >= paramArrayOfDouble2[m]) {
              break label249;
            }
            paramArrayOfDouble2[m] = d2;
            localc.b(locale2, d2);
          }
          paramArrayOfd[m] = locald;
          locald = locald.i();
        } while (!bool);
        if (paramBoolean) {
          break;
        }
        locald = locale1.i();
        if (locald == null) {
          break;
        }
        locale2 = locald.e();
        m = locale2.f();
        d2 = d1 + paramArrayOfDouble1[locald.d()];
      } while (bool);
      if ((paramArrayOfd[m] == null) && (locale2 != parame))
      {
        paramArrayOfDouble2[m] = d2;
        localc.a(locale2, d2);
        if ((n == 0) && (!bool)) {}
      }
      else
      {
        if (n != 0) {
          continue;
        }
        if (d2 >= paramArrayOfDouble2[m]) {
          break label391;
        }
        paramArrayOfDouble2[m] = d2;
        localc.b(locale2, d2);
      }
      paramArrayOfd[m] = locald;
      d locald = locald.j();
    } while (!bool);
    label261:
    label272:
    return;
  }
  
  public static void a(a.c.q paramq, e parame, boolean paramBoolean, k paramk, a.c.x paramx1, a.c.x paramx2)
  {
    double[] arrayOfDouble1 = a(paramq, paramk);
    double[] arrayOfDouble2 = b(paramq);
    d[] arrayOfd = c(paramq);
    a(paramq, parame, paramBoolean, arrayOfDouble1, arrayOfDouble2, arrayOfd);
    a(paramq, arrayOfDouble2, paramx1);
    a(paramq, arrayOfd, paramx2);
  }
  
  public static double a(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, double[] paramArrayOfDouble, d[] paramArrayOfd)
  {
    return c(paramq, parame1, parame2, paramBoolean, paramArrayOfDouble, paramArrayOfd);
  }
  
  public static ab a(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, double[] paramArrayOfDouble)
  {
    d[] arrayOfd = new d[paramq.j()];
    if (a(paramq, parame1, parame2, paramBoolean, paramArrayOfDouble, arrayOfd) != (1.0D / 0.0D)) {
      return b(parame1, parame2, arrayOfd);
    }
    return new ab();
  }
  
  public static ab a(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, k paramk)
  {
    double[] arrayOfDouble = a(paramq, paramk);
    return a(paramq, parame1, parame2, paramBoolean, arrayOfDouble);
  }
  
  public static double a(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, k paramk, a.c.x paramx)
  {
    double[] arrayOfDouble = a(paramq, paramk);
    d[] arrayOfd = c(paramq);
    double d = c(paramq, parame1, parame2, paramBoolean, arrayOfDouble, arrayOfd);
    a(paramq, arrayOfd, paramx);
    return d;
  }
  
  private static double c(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, double[] paramArrayOfDouble, d[] paramArrayOfd)
  {
    int i2 = m.b;
    boolean bool = m.a;
    e[] arrayOfe = new e[2];
    arrayOfe[0] = parame1;
    arrayOfe[1] = parame2;
    double[][] arrayOfDouble = new double[2][paramq.j()];
    d[][] arrayOfd = new d[2][paramq.j()];
    g[] arrayOfg = new g[2];
    arrayOfg[0] = new c(paramq);
    arrayOfg[1] = new c(paramq);
    arrayOfg[0].a(arrayOfe[0], 0.0D);
    arrayOfg[1].a(arrayOfe[1], 0.0D);
    int i = parame1 != parame2 ? 1 : 0;
    double d1 = 0.0D;
    label130:
    label150:
    label354:
    label359:
    label491:
    label493:
    label877:
    label882:
    do
    {
      if (arrayOfg[0].a())
      {
        if (arrayOfg[1].a()) {}
      }
      else
      {
        int j;
        do
        {
          j = 0;
          do
          {
            do
            {
              if (j >= 2) {
                break;
              }
            } while (i2 != 0);
            if (bool) {
              break label130;
            }
          } while (i2 != 0);
        } while (bool);
        if (!arrayOfg[j].a())
        {
          e locale1 = arrayOfg[j].b();
          int k = locale1.f();
          Object localObject;
          if ((locale1 == arrayOfe[(1 - j)]) || (arrayOfd[(1 - j)][k] != null))
          {
            if (i2 != 0) {
              break label411;
            }
            if (!arrayOfg[(1 - j)].a(locale1))
            {
              if (i2 != 0) {
                break label411;
              }
              if (arrayOfDouble[0][k] + arrayOfDouble[1][k] == d1)
              {
                localObject = locale1;
                m = ((e)localObject).f();
                do
                {
                  do
                  {
                    if (localObject == parame1) {
                      break;
                    }
                    paramArrayOfd[m] = arrayOfd[0][m];
                    localObject = paramArrayOfd[m].a((e)localObject);
                    m = ((e)localObject).f();
                    if (i2 != 0) {
                      break label359;
                    }
                    if (bool) {
                      break label354;
                    }
                  } while (!bool);
                } while (i2 != 0);
                localObject = locale1;
                m = ((e)localObject).f();
                do
                {
                  while (!bool)
                  {
                    d locald;
                    if ((locald = arrayOfd[1][m]) == null) {
                      break;
                    }
                    localObject = locald.a((e)localObject);
                    m = ((e)localObject).f();
                    paramArrayOfd[m] = locald;
                  }
                } while (i2 != 0);
                return d1;
              }
            }
          }
          int m = 0;
          if (i2 == 0) {
            if (!paramBoolean)
            {
              localObject = locale1.h();
              if (i2 != 0) {
                break label493;
              }
              if (localObject != null) {
                break label491;
              }
              if (i2 != 0) {
                break label493;
              }
              localObject = locale1.i();
              m = 1;
              if (!bool) {
                break label491;
              }
            }
          }
          if (j == 0)
          {
            localObject = locale1.h();
            if (i2 == 0) {
              if (!bool) {
                break label491;
              }
            }
          }
          else
          {
            localObject = locale1.i();
          }
          m = 1;
          do
          {
            do
            {
              do
              {
                do
                {
                  e locale2;
                  int i1;
                  do
                  {
                    do
                    {
                      do
                      {
                        do
                        {
                          if (localObject == null) {
                            break label877;
                          }
                          int n = ((d)localObject).d();
                          locale2 = ((d)localObject).a(locale1);
                          i1 = locale2.f();
                          double d2 = arrayOfDouble[j][k] + paramArrayOfDouble[n];
                          if ((arrayOfd[j][i1] == null) && (locale2 != arrayOfe[j]))
                          {
                            arrayOfDouble[j][i1] = d2;
                            arrayOfg[j].a(locale2, d2);
                            if (i2 != 0) {
                              break label727;
                            }
                            if (!bool) {
                              break;
                            }
                          }
                          if (i2 == 0) {
                            if (d2 < arrayOfDouble[j][i1])
                            {
                              arrayOfg[j].b(locale2, d2);
                              arrayOfDouble[j][i1] = d2;
                              if (i2 != 0) {
                                break label727;
                              }
                              if (!bool) {
                                break;
                              }
                            }
                          }
                          localObject = m != 0 ? ((d)localObject).j() : ((d)localObject).i();
                        } while (localObject != null);
                        if (i2 != 0) {
                          break label150;
                        }
                        if (bool) {
                          break;
                        }
                      } while (paramBoolean);
                      if (i2 != 0) {
                        break label709;
                      }
                    } while (m != 0);
                    localObject = locale1.i();
                    m = 1;
                    if (i2 != 0) {
                      break label727;
                    }
                  } while (!bool);
                  if (i2 == 0)
                  {
                    arrayOfd[j][i1] = localObject;
                    if (locale2 == arrayOfe[(1 - j)]) {}
                  }
                  else
                  {
                    if (arrayOfd[(1 - j)][i1] == null) {
                      break label808;
                    }
                  }
                  if (i2 == 0) {
                    if (i == 0)
                    {
                      if (i2 != 0) {
                        break label810;
                      }
                      if (arrayOfDouble[0][i1] + arrayOfDouble[1][i1] >= d1) {
                        break label808;
                      }
                    }
                  }
                  i = 0;
                  d1 = arrayOfDouble[0][i1] + arrayOfDouble[1][i1];
                  localObject = m != 0 ? ((d)localObject).j() : ((d)localObject).i();
                } while (i2 != 0);
              } while ((localObject != null) || ((i2 == 0) && (paramBoolean)));
              if (i2 != 0) {
                break label869;
              }
            } while (m != 0);
            localObject = locale1.i();
            m = 1;
            if (i2 != 0) {
              break label882;
            }
          } while (!bool);
        }
        j++;
        if (!bool) {
          break;
        }
      }
      paramArrayOfd[parame2.f()] = null;
    } while (i2 != 0);
    label411:
    label709:
    label727:
    label869:
    return (1.0D / 0.0D);
  }
  
  public static boolean b(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
  {
    return b(paramq, parame, paramBoolean, paramArrayOfDouble1, paramArrayOfDouble2, new d[paramq.j()]);
  }
  
  public static boolean b(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, d[] paramArrayOfd)
  {
    int i1 = m.b;
    boolean bool = m.a;
    int i = paramq.j();
    int j = 0;
    h localh = new h(i + 1);
    boolean[] arrayOfBoolean1 = new boolean[i];
    int n = 0;
    do
    {
      if (n >= i) {
        break;
      }
      paramArrayOfd[n] = null;
      paramArrayOfDouble2[n] = (1.0D / 0.0D);
      n++;
      if ((i1 == 0) && (bool)) {
        break label107;
      }
    } while (!bool);
    paramArrayOfDouble2[parame.f()] = 0.0D;
    localh.b(parame);
    label107:
    label113:
    label115:
    d locald;
    e locale2;
    int m;
    if (i1 == 0)
    {
      arrayOfBoolean1[parame.f()] = true;
      localh.b(null);
      break label338;
      if (j < i) {}
      label336:
      label338:
      label468:
      while (i1 != 0)
      {
        e locale1 = (e)localh.c();
        if (i1 == 0) {
          if (locale1 == null)
          {
            j++;
            if (i1 == 0)
            {
              if (localh.g()) {
                return true;
              }
              localh.b(null);
            }
            if ((i1 == 0) && (!bool)) {
              break label113;
            }
          }
        }
        int k = locale1.f();
        arrayOfBoolean1[k] = false;
        double d1 = paramArrayOfDouble2[k];
        locald = locale1.h();
        do
        {
          if (locald == null) {
            break;
          }
          locale2 = locald.f();
          m = locale2.f();
          d2 = d1 + paramArrayOfDouble1[locald.d()];
          if (bool) {
            break label336;
          }
          if ((paramArrayOfd[m] != null) || (locale2 == parame))
          {
            if (i1 != 0) {
              continue;
            }
            if (d2 >= paramArrayOfDouble2[m]) {}
          }
          else
          {
            paramArrayOfDouble2[m] = d2;
            paramArrayOfd[m] = locald;
            if (i1 != 0) {
              continue;
            }
            if (arrayOfBoolean1[m] == 0)
            {
              localh.b(locale2);
              arrayOfBoolean1[m] = true;
            }
          }
          locald = locald.i();
        } while (!bool);
        if (i1 != 0) {
          break label115;
        }
        if (paramBoolean) {
          break label113;
        }
        locald = locale1.i();
        if (locald == null) {
          break label113;
        }
        locale2 = locald.e();
        m = locale2.f();
        double d2 = d1 + paramArrayOfDouble1[locald.d()];
        if ((i1 != 0) || ((i1 == 0) && ((bool) || (bool)))) {
          break label483;
        }
        if ((paramArrayOfd[m] != null) || (locale2 == parame))
        {
          if (i1 != 0) {
            break label468;
          }
          if (d2 >= paramArrayOfDouble2[m]) {}
        }
        else
        {
          paramArrayOfDouble2[m] = d2;
          paramArrayOfd[m] = locald;
          if (i1 != 0) {
            break label468;
          }
          if (arrayOfBoolean1[m] == 0)
          {
            localh.b(locale2);
            arrayOfBoolean1[m] = true;
          }
        }
        locald = locald.j();
        if (!bool) {
          break;
        }
      }
      if (paramArrayOfd[parame.f()] != null) {
        label483:
        return false;
      }
    }
    boolean[] arrayOfBoolean2 = new boolean[paramq.j()];
    boolean[] arrayOfBoolean3 = new boolean[paramq.l()];
    Object localObject = paramq.w();
    do
    {
      do
      {
        if (!((a.c.m)localObject).e()) {
          break;
        }
        locald = ((a.c.m)localObject).a();
        if (bool) {
          break label628;
        }
        if (locald != paramArrayOfd[locald.f().f()]) {
          arrayOfBoolean3[locald.d()] = true;
        }
        ((a.c.m)localObject).f();
      } while (!bool);
    } while (i1 != 0);
    if (!paramBoolean)
    {
      localObject = paramq.w();
      label628:
      do
      {
        if (!((a.c.m)localObject).e()) {
          break;
        }
        locald = ((a.c.m)localObject).a();
        if (i1 != 0) {
          break label671;
        }
        if (bool) {
          break label667;
        }
        if (locald != paramArrayOfd[locald.e().f()]) {
          arrayOfBoolean3[locald.d()] = true;
        }
        ((a.c.m)localObject).f();
      } while (!bool);
    }
    if (i1 == 0) {
      m.a(paramq, parame, paramBoolean, arrayOfBoolean3, arrayOfBoolean2);
    }
    label667:
    label671:
    localObject = new boolean[paramq.j()];
    w localw = paramq.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      locale2 = localw.d();
      m = locale2.f();
      if (bool) {
        break label759;
      }
      if (arrayOfBoolean1[m] != 0)
      {
        if (i1 != 0) {
          continue;
        }
        if (localObject[m] == 0) {
          a(paramq, locale2, paramBoolean, arrayOfBoolean2, (boolean[])localObject, paramArrayOfd);
        }
      }
      localw.f();
    } while (!bool);
    label759:
    return false;
  }
  
  public static boolean b(a.c.q paramq, e parame, boolean paramBoolean, k paramk, a.c.x paramx1, a.c.x paramx2)
  {
    double[] arrayOfDouble1 = a(paramq, paramk);
    double[] arrayOfDouble2 = b(paramq);
    d[] arrayOfd = c(paramq);
    boolean bool = b(paramq, parame, paramBoolean, arrayOfDouble1, arrayOfDouble2, arrayOfd);
    a(paramq, arrayOfDouble2, paramx1);
    a(paramq, arrayOfd, paramx2);
    return bool;
  }
  
  private static void a(a.c.q paramq, e parame, boolean paramBoolean, boolean[] paramArrayOfBoolean1, boolean[] paramArrayOfBoolean2, d[] paramArrayOfd)
  {
    int j = m.b;
    boolean bool = m.a;
    paramArrayOfBoolean2[parame.f()] = true;
    d locald = parame.h();
    e locale;
    int i;
    do
    {
      if (locald == null) {
        break;
      }
      locale = locald.f();
      i = locale.f();
      if (bool) {
        break label100;
      }
      if (paramArrayOfBoolean2[i] == 0)
      {
        if (paramArrayOfBoolean1[i] != 0) {
          paramArrayOfd[i] = locald;
        }
        a(paramq, locale, paramBoolean, paramArrayOfBoolean1, paramArrayOfBoolean2, paramArrayOfd);
      }
      locald = locald.i();
    } while (!bool);
    if ((j == 0) && (!paramBoolean))
    {
      label100:
      locald = parame.i();
      do
      {
        if (locald == null) {
          break;
        }
        locale = locald.e();
        i = locale.f();
        if (j == 0)
        {
          if (paramArrayOfBoolean2[i] == 0)
          {
            if (paramArrayOfBoolean1[i] != 0) {
              paramArrayOfd[i] = locald;
            }
            a(paramq, locale, paramBoolean, paramArrayOfBoolean1, paramArrayOfBoolean2, paramArrayOfd);
          }
          locald = locald.j();
        }
      } while (!bool);
    }
  }
  
  public static boolean c(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2)
  {
    return c(paramq, parame, paramBoolean, paramArrayOfDouble1, paramArrayOfDouble2, new d[paramq.j()]);
  }
  
  public static boolean c(a.c.q paramq, e parame, boolean paramBoolean, double[] paramArrayOfDouble1, double[] paramArrayOfDouble2, d[] paramArrayOfd)
  {
    int j = m.b;
    boolean bool = m.a;
    if (j == 0) {
      if (paramBoolean)
      {
        if (j != 0) {
          break label40;
        }
        if (a(paramq, parame, paramArrayOfDouble1, paramArrayOfDouble2, paramArrayOfd)) {
          return true;
        }
      }
    }
    label40:
    int i = 1;
    a.c.m localm = paramq.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      if (bool) {
        break label112;
      }
      if (paramArrayOfDouble1[localm.a().d()] < 0.0D)
      {
        i = 0;
        if (j == 0) {
          if (!bool) {
            break;
          }
        }
      }
      else
      {
        localm.f();
      }
    } while (!bool);
    if ((j == 0) && (i != 0))
    {
      label112:
      a(paramq, parame, paramBoolean, paramArrayOfDouble1, paramArrayOfDouble2, paramArrayOfd);
      return true;
    }
    return b(paramq, parame, paramBoolean, paramArrayOfDouble1, paramArrayOfDouble2, paramArrayOfd);
  }
  
  public static boolean c(a.c.q paramq, e parame, boolean paramBoolean, k paramk, a.c.x paramx1, a.c.x paramx2)
  {
    double[] arrayOfDouble1 = a(paramq, paramk);
    double[] arrayOfDouble2 = b(paramq);
    d[] arrayOfd = c(paramq);
    boolean bool = c(paramq, parame, paramBoolean, arrayOfDouble1, arrayOfDouble2, arrayOfd);
    a(paramq, arrayOfDouble2, paramx1);
    a(paramq, arrayOfd, paramx2);
    return bool;
  }
  
  public static boolean a(a.c.q paramq, boolean paramBoolean, double[] paramArrayOfDouble, double[][] paramArrayOfDouble1)
  {
    int i3 = m.b;
    boolean bool = m.a;
    int i = paramq.l();
    e locale = paramq.i();
    ab localab = new ab();
    Object localObject1 = paramq.v();
    do
    {
      do
      {
        if (!((w)localObject1).e()) {
          break;
        }
        localObject2 = ((w)localObject1).d();
        if (localObject2 != locale) {
          localab.c(paramq.a(locale, (e)localObject2));
        }
        ((w)localObject1).f();
      } while (!bool);
    } while (i3 != 0);
    localObject1 = new double[paramq.l()];
    Object localObject2 = new double[paramq.j()];
    d[] arrayOfd = new d[paramq.j()];
    System.arraycopy(paramArrayOfDouble, 0, localObject1, 0, i);
    if (i3 == 0) {}
    int j = !b(paramq, locale, paramBoolean, (double[])localObject1, (double[])localObject2, arrayOfd) ? 1 : 0;
    if (!localab.isEmpty()) {}
    while (i3 != 0)
    {
      paramq.a(localab.o());
      if (i3 != 0) {
        break label205;
      }
      if (bool) {
        break label203;
      }
      if (!bool) {
        break;
      }
    }
    paramq.a(locale);
    label203:
    label205:
    if ((i3 != 0) || (j != 0)) {
      return false;
    }
    Object localObject3 = paramq.w();
    do
    {
      if (!((a.c.m)localObject3).e()) {
        break;
      }
      d locald = ((a.c.m)localObject3).a();
      int n = locald.d();
      localObject1[n] = (localObject2[locald.e().f()] + paramArrayOfDouble[n] - localObject2[locald.f().f()]);
      ((a.c.m)localObject3).f();
    } while (!bool);
    localObject3 = paramq.v();
    do
    {
      while (!bool)
      {
        if (!((w)localObject3).e()) {
          break;
        }
        if (bool) {
          break label359;
        }
        a(paramq, ((w)localObject3).d(), paramBoolean, (double[])localObject1, paramArrayOfDouble1[localObject3.d().f()], arrayOfd);
        ((w)localObject3).f();
      }
    } while (i3 != 0);
    label359:
    int k = Math.min(paramq.j(), paramArrayOfDouble1.length);
    int m = 0;
    do
    {
      if (m >= k) {
        break;
      }
      double d = localObject2[m];
      int i1 = Math.min(paramq.j(), localObject2.length);
      if (bool) {
        break label463;
      }
      int i2 = 0;
      if (i2 < i1)
      {
        paramArrayOfDouble1[m][i2] += localObject2[i2] - d;
        i2++;
      }
      for (;;)
      {
        if (i3 == 0) {
          if (!bool)
          {
            if (!bool) {
              break;
            }
            if (i3 != 0) {
              continue;
            }
            m++;
          }
        }
      }
    } while (!bool);
    label463:
    return true;
  }
  
  public static void a(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, n paramn)
  {
    int k = m.b;
    boolean bool = m.a;
    a.c.x localx1 = db.a(new int[paramq.j()]);
    a.c.x localx2 = db.a(new boolean[paramq.j()]);
    bb[] arrayOfbb = b.a(paramq, new bb(parame1), paramBoolean, localx1);
    int i = localx1.getInt(parame2);
    d locald1 = parame2.i();
    if (locald1 != null) {}
    for (;;)
    {
      if (k == 0) {
        if (!bool)
        {
          if (localx1.getInt(locald1.e()) + 1 == localx1.getInt(locald1.f()))
          {
            paramn.a(locald1, true);
            localx2.a(locald1.e(), true);
          }
          locald1 = locald1.j();
          if (!bool) {
            break;
          }
          if (k != 0) {
            continue;
          }
          if (k == 0)
          {
            if (!paramBoolean)
            {
              locald1 = parame2.h();
              if (locald1 == null) {}
            }
            while (k != 0)
            {
              if (k != 0) {
                break label252;
              }
              if (bool) {
                break label251;
              }
              if (localx1.getInt(locald1.f()) + 1 == localx1.getInt(locald1.e()))
              {
                paramn.a(locald1, true);
                localx2.a(locald1.f(), true);
              }
              locald1 = locald1.i();
              if (!bool) {
                break;
              }
            }
          }
        }
      }
    }
    label251:
    label252:
    int j = i - 1;
    label276:
    label449:
    label451:
    label492:
    label504:
    do
    {
      do
      {
        if (j <= 0) {
          break;
        }
        break label276;
        w localw = arrayOfbb[j].l();
        do
        {
          if (!localw.e()) {
            break label504;
          }
          if (bool) {
            break;
          }
          if (localx2.getBool(localw.d()))
          {
            do
            {
              locald2 = localw.d().i();
              if (locald2 != null) {}
              while (k != 0)
              {
                if (k != 0) {
                  break label451;
                }
                if (bool) {
                  break label449;
                }
                if (localx1.getInt(locald2.e()) + 1 == localx1.getInt(locald2.f()))
                {
                  paramn.a(locald2, true);
                  localx2.a(locald2.e(), true);
                }
                locald2 = locald2.j();
                if (!bool) {
                  break;
                }
              }
              if (paramBoolean) {
                break label492;
              }
            } while (k != 0);
            d locald2 = localw.d().h();
            do
            {
              if (locald2 == null) {
                break label492;
              }
              if (bool) {
                break;
              }
              if (localx1.getInt(locald2.f()) + 1 == localx1.getInt(locald2.e()))
              {
                paramn.a(locald2, true);
                localx2.a(locald2.f(), true);
              }
              locald2 = locald2.i();
            } while (!bool);
          }
          localw.f();
        } while (!bool);
        j--;
      } while (k != 0);
    } while (!bool);
  }
  
  public static z a(a.c.q paramq, k paramk, e parame1, e parame2, int paramInt)
  {
    return new nb().a(paramq, paramk, parame1, parame2, paramInt);
  }
  
  public static a.c.y b(a.c.q paramq, k paramk, e parame1, e parame2, int paramInt)
  {
    return new nb().c(paramq, paramk, parame1, parame2, paramInt);
  }
  
  public static double[] a(a.c.q paramq)
  {
    int j = m.b;
    boolean bool = m.a;
    double[] arrayOfDouble = new double[paramq.l()];
    do
    {
      for (int i = 0; !bool; i++)
      {
        if (i >= paramq.l()) {
          break;
        }
        if ((j == 0) && (bool)) {
          break label52;
        }
        arrayOfDouble[i] = 1.0D;
      }
    } while (j != 0);
    label52:
    return arrayOfDouble;
  }
  
  public static bb a(e parame1, e parame2, d[] paramArrayOfd)
  {
    return a(parame1, parame2, a.i.q.b(paramArrayOfd));
  }
  
  public static bb a(e parame1, e parame2, k paramk)
  {
    int i = m.b;
    boolean bool = m.a;
    bb localbb = new bb();
    d locald = (d)paramk.get(parame2);
    if (locald != null)
    {
      localbb.c(parame2);
      if (locald != null) {
        parame2 = locald.a(parame2);
      }
    }
    while (i != 0)
    {
      if (i == 0)
      {
        if (bool) {
          break label92;
        }
        localbb.c(parame2);
      }
      locald = (d)paramk.get(parame2);
      if (!bool) {
        break;
      }
    }
    label92:
    return localbb;
  }
  
  public static ab b(e parame1, e parame2, d[] paramArrayOfd)
  {
    return b(parame1, parame2, a.i.q.b(paramArrayOfd));
  }
  
  public static ab b(e parame1, e parame2, k paramk)
  {
    int i = m.b;
    boolean bool = m.a;
    ab localab = new ab();
    d locald = (d)paramk.get(parame2);
    do
    {
      while (!bool)
      {
        if (locald == null) {
          break;
        }
        if (i == 0)
        {
          if (bool) {
            break label82;
          }
          localab.c(locald);
          parame2 = locald.a(parame2);
        }
        locald = (d)paramk.get(parame2);
      }
    } while (i != 0);
    label82:
    return localab;
  }
  
  private static double[] a(a.c.q paramq, k paramk)
  {
    int i = m.b;
    boolean bool = m.a;
    double[] arrayOfDouble = new double[paramq.l()];
    a.c.m localm = paramq.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      if ((i == 0) && (bool)) {
        break label76;
      }
      arrayOfDouble[locald.d()] = paramk.getDouble(locald);
      localm.f();
    } while (!bool);
    label76:
    return arrayOfDouble;
  }
  
  private static double[] c(a.c.q paramq, k paramk)
  {
    int i = m.b;
    boolean bool = m.a;
    double[] arrayOfDouble = new double[paramq.j()];
    w localw = paramq.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      if ((i == 0) && (bool)) {
        break label76;
      }
      arrayOfDouble[locale.f()] = paramk.getDouble(locale);
      localw.f();
    } while (!bool);
    label76:
    return arrayOfDouble;
  }
  
  private static double[] b(a.c.q paramq)
  {
    return new double[paramq.j()];
  }
  
  private static d[] c(a.c.q paramq)
  {
    return new d[paramq.j()];
  }
  
  private static void a(a.c.q paramq, double[] paramArrayOfDouble, a.c.x paramx)
  {
    boolean bool = m.a;
    w localw = paramq.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      paramx.a(locale, paramArrayOfDouble[locale.f()]);
      localw.f();
    } while (!bool);
  }
  
  private static void a(a.c.q paramq, d[] paramArrayOfd, a.c.x paramx)
  {
    boolean bool = m.a;
    w localw = paramq.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      paramx.a(locale, paramArrayOfd[locale.f()]);
      localw.f();
    } while (!bool);
  }
  
  public static void a(a.c.q paramq, e parame, k paramk, boolean paramBoolean, int paramInt, ab paramab, bb parambb)
  {
    int n = m.b;
    boolean bool = m.a;
    if ((parame != null) && (paramInt >= 1))
    {
      if (paramab == null)
      {
        if (n != 0) {
          break label38;
        }
        if (parambb != null) {}
      }
    }
    else {
      return;
    }
    label38:
    if ((n != 0) || (parambb != null)) {
      parambb.clear();
    }
    if ((n != 0) || (paramab != null)) {
      paramab.clear();
    }
    if (n == 0) {}
    bb localbb = parambb != null ? parambb : new bb();
    a.c.x localx = db.a(new int[paramq.j()]);
    h localh = new h(paramq.j() + 1);
    Object localObject1 = new Object();
    localh.a(parame);
    localh.a(localObject1);
    localx.a(parame, 1);
    localbb.add(parame);
    int i = 2;
    break label369;
    label157:
    label162:
    label163:
    if (localh.e() > 1) {}
    Object localObject3;
    Object localObject4;
    label356:
    label369:
    label505:
    while (n != 0)
    {
      if (n == 0) {
        if (localh.a() == localObject1)
        {
          localh.a(localh.b());
          if (i > paramInt) {
            continue;
          }
          i++;
        }
      }
      localObject2 = (e)localh.b();
      localObject3 = ((e)localObject2).h();
      do
      {
        if (localObject3 == null) {
          break;
        }
        localObject4 = ((d)localObject3).f();
        k = localx.getInt(localObject4);
        if (bool) {
          break label356;
        }
        if (k == 0)
        {
          localh.a(localObject4);
          localx.a(localObject4, i);
          if (n == 0)
          {
            if (paramab != null) {
              paramab.add(localObject3);
            }
            localbb.add(localObject4);
          }
          if (n != 0) {
            continue;
          }
          if (!bool) {}
        }
        else
        {
          if (n != 0) {
            continue;
          }
          if ((k == i) && ((n != 0) || (paramab != null))) {
            paramab.add(localObject3);
          }
        }
        localObject3 = ((d)localObject3).i();
      } while (!bool);
      if ((n == 0) && (paramBoolean)) {
        break label157;
      }
      localObject3 = ((e)localObject2).i();
      if (localObject3 == null) {
        break label157;
      }
      localObject4 = ((d)localObject3).e();
      int k = localx.getInt(localObject4);
      if (n != 0) {
        break label163;
      }
      if (bool) {
        break label162;
      }
      if (bool) {
        break label643;
      }
      if (k == 0)
      {
        localh.a(localObject4);
        localx.a(localObject4, i);
        if (n == 0)
        {
          if (paramab != null) {
            paramab.add(localObject3);
          }
          localbb.add(localObject4);
        }
        if (n != 0) {
          break label505;
        }
        if (!bool) {}
      }
      else
      {
        if (n != 0) {
          break label505;
        }
        if ((k == i) && ((n != 0) || (paramab != null))) {
          paramab.add(localObject3);
        }
      }
      localObject3 = ((d)localObject3).j();
      if (!bool) {
        break;
      }
    }
    if (paramk == null) {
      return;
    }
    localh.d();
    Object localObject2 = localbb.l();
    do
    {
      if (!((w)localObject2).e()) {
        break;
      }
      localObject3 = ((w)localObject2).d();
      if (bool) {
        break label643;
      }
      if (paramk.getBool(localObject3))
      {
        localx.a(localObject3, -localx.getInt(localObject3));
        localh.a(localObject3);
      }
      ((w)localObject2).f();
    } while (!bool);
    if (n == 0)
    {
      if ((n != 0) || (parambb != null)) {
        parambb.clear();
      }
      if ((n != 0) || (paramab != null)) {
        paramab.clear();
      }
    }
    label643:
    label693:
    label830:
    label839:
    label1003:
    do
    {
      int j;
      e locale;
      int m;
      do
      {
        if (localh.g()) {
          break;
        }
        localObject2 = (e)localh.b();
        j = -localx.getInt(localObject2);
        if ((n != 0) || (parambb != null)) {
          parambb.add(localObject2);
        }
        localObject4 = ((e)localObject2).i();
        if (localObject4 != null)
        {
          locale = ((d)localObject4).e();
          m = localx.getInt(locale);
        }
        do
        {
          if (!bool)
          {
            if (m < 0)
            {
              if (n != 0) {
                break label771;
              }
              if (-m + 1 == j)
              {
                if ((n == 0) && (paramab == null)) {
                  break label830;
                }
                paramab.add(localObject4);
                if (n != 0) {
                  break label839;
                }
                if (!bool) {
                  break label830;
                }
              }
            }
            if (n == 0)
            {
              if (m > 0)
              {
                if (n != 0) {
                  break label839;
                }
                if (m + 1 == j)
                {
                  if ((n != 0) || (paramab != null)) {
                    paramab.add(localObject4);
                  }
                  localh.a(locale);
                  localx.a(locale, -m);
                }
              }
              localObject4 = ((d)localObject4).j();
            }
            if (!bool) {
              break label693;
            }
          }
          if ((n == 0) && (paramBoolean)) {
            break;
          }
          localObject4 = ((e)localObject2).h();
          if (localObject4 == null) {
            break;
          }
          locale = ((d)localObject4).f();
          m = localx.getInt(locale);
        } while (n != 0);
      } while (bool);
      if (m < 0)
      {
        if (n != 0) {
          break label944;
        }
        if (-m + 1 == j)
        {
          if ((n == 0) && (paramab == null)) {
            break label1003;
          }
          paramab.add(localObject4);
          if (n != 0) {
            continue;
          }
          if (!bool) {
            break label1003;
          }
        }
      }
      if (n == 0)
      {
        if (m > 0)
        {
          if (n != 0) {
            continue;
          }
          if (m + 1 == j)
          {
            if ((n != 0) || (paramab != null)) {
              paramab.add(localObject4);
            }
            localh.a(locale);
            localx.a(locale, -m);
          }
        }
        localObject4 = ((d)localObject4).i();
      }
    } while (!bool);
    label771:
    label944:
    return;
  }
  
  public static final ab[] b(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, k paramk)
  {
    pb localpb = new pb(paramq);
    n localn = db.b();
    localpb.c(localpb.w(), paramk, localn);
    ab[] arrayOfab = c(localpb, localpb.l(parame1), localpb.l(parame2), paramBoolean, localn);
    if (m.b == 0) {
      if (arrayOfab != null) {
        arrayOfab = new ab[] { localpb.a(arrayOfab[0]), localpb.a(arrayOfab[1]) };
      }
    }
    return arrayOfab;
  }
  
  private static final ab[] c(a.c.q paramq, e parame1, e parame2, boolean paramBoolean, k paramk)
  {
    int j = m.b;
    boolean bool = m.a;
    ab localab = new ab();
    n localn1 = db.b();
    n localn2 = null;
    if (!paramBoolean)
    {
      localn2 = db.b();
      int i = paramq.m();
      localObject1 = paramq.w();
      do
      {
        if (i <= 0) {
          break;
        }
        localObject2 = ((a.c.m)localObject1).a();
        localn1.a(localObject2, paramk.getDouble(localObject2));
        localObject3 = paramq.a(((d)localObject2).f(), ((d)localObject2).e());
        localn2.a(localObject3, localObject2);
        localab.add(localObject3);
        localn1.a(localObject3, paramk.getDouble(localObject2));
        ((a.c.m)localObject1).f();
        i--;
        if ((j == 0) && (bool)) {
          break label172;
        }
      } while (!bool);
      paramk = localn1;
      if (j == 0) {
        localn1 = db.b();
      }
    }
    label172:
    a.c.x localx = db.a();
    Object localObject1 = db.a();
    c(paramq, parame1, true, paramk, localx, (a.c.x)localObject1);
    if (((a.c.x)localObject1).get(parame2) == null)
    {
      localObject2 = localab.l();
      do
      {
        while (!bool)
        {
          if (!((a.c.m)localObject2).e()) {
            break;
          }
          paramq.a(((a.c.m)localObject2).a());
          ((a.c.m)localObject2).f();
        }
      } while (j != 0);
      return null;
    }
    Object localObject2 = new a.i.y(paramq);
    Object localObject3 = paramq.w();
    do
    {
      if (!((a.c.m)localObject3).e()) {
        break;
      }
      localObject4 = ((a.c.m)localObject3).a();
      double d1 = localx.getDouble(((d)localObject4).e());
      double d2 = localx.getDouble(((d)localObject4).f());
      if (j == 0)
      {
        if (bool) {
          break label386;
        }
        localn1.a(localObject4, paramk.getDouble(localObject4) - d2 + d1);
      }
      if (j == 0)
      {
        if (((d)localObject4).f() == parame1) {
          ((a.i.y)localObject2).a((d)localObject4);
        }
        ((a.c.m)localObject3).f();
      }
    } while (!bool);
    label386:
    localObject3 = db.b();
    Object localObject4 = b(parame1, parame2, (k)localObject1);
    Object localObject5 = ((ab)localObject4).l();
    do
    {
      if (!((a.c.m)localObject5).e()) {
        break;
      }
      localObject6 = ((a.c.m)localObject5).a();
      paramq.e((d)localObject6);
      ((n)localObject3).a(localObject6, 1);
      ((a.c.m)localObject5).f();
    } while (!bool);
    localObject5 = db.a();
    Object localObject6 = db.a();
    c(paramq, parame1, true, localn1, (a.c.x)localObject6, (a.c.x)localObject5);
    ab[] arrayOfab = null;
    Object localObject8;
    if (((a.c.x)localObject5).get(parame2) != null)
    {
      localObject7 = b(parame1, parame2, (k)localObject5);
      localObject8 = ((ab)localObject7).l();
      do
      {
        if (!((a.c.m)localObject8).e()) {
          break;
        }
        d locald = ((a.c.m)localObject8).a();
        if ((j == 0) && (bool)) {
          break label569;
        }
        if (((n)localObject3).getInt(locald) == 1) {
          ((n)localObject3).a(locald, 2);
        }
        ((a.c.m)localObject8).f();
      } while (!bool);
      label569:
      arrayOfab = new ab[] { a(paramq, parame1, parame2, (a.c.x)localObject5, (a.c.x)localObject1, (k)localObject3, localn2), a(paramq, parame1, parame2, (a.c.x)localObject1, (a.c.x)localObject5, (k)localObject3, localn2) };
    }
    ((a.i.y)localObject2).g();
    Object localObject7 = paramq.w();
    do
    {
      do
      {
        if (!((a.c.m)localObject7).e()) {
          break;
        }
        localObject8 = ((a.c.m)localObject7).a();
        if (bool) {
          break label692;
        }
        if (((n)localObject3).getInt(localObject8) != 0) {
          paramq.e((d)localObject8);
        }
        ((a.c.m)localObject7).f();
      } while (!bool);
    } while (j != 0);
    localObject7 = localab.l();
    label692:
    do
    {
      while (!bool)
      {
        if (!((a.c.m)localObject7).e()) {
          break;
        }
        paramq.a(((a.c.m)localObject7).a());
        ((a.c.m)localObject7).f();
      }
    } while (j != 0);
    return arrayOfab;
  }
  
  private static ab a(a.c.q paramq, e parame1, e parame2, a.c.x paramx1, a.c.x paramx2, k paramk1, k paramk2)
  {
    int i = m.b;
    boolean bool = m.a;
    ab localab = new ab();
    d locald = (d)paramx1.get(parame2);
    localab.c(a(locald, paramk2));
    e locale = locald.a(parame2);
    if (locale != parame1) {}
    while (i != 0)
    {
      locald = (d)paramx1.get(locale);
      if (i == 0)
      {
        if (paramk1.getInt(locald) == 2)
        {
          a.c.x localx = paramx1;
          paramx1 = paramx2;
          paramx2 = localx;
          locald = (d)paramx1.get(locale);
        }
        localab.c(a(locald, paramk2));
        locale = locald.a(locale);
      }
      if (!bool) {
        break;
      }
    }
    return localab;
  }
  
  private static d a(d paramd, k paramk)
  {
    int i = m.b;
    if ((i != 0) || (paramk != null))
    {
      d locald = (d)paramk.get(paramd);
      if (i != 0) {
        break label34;
      }
      if (locald != null) {
        return locald;
      }
    }
    label34:
    return paramd;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.a.fb
 * JD-Core Version:    0.7.0.1
 */